package process

var userManager *UserManager

type UserManager struct {
	onlineUsers map[int64]*UserProcess
}

func init() {
	userManager = &UserManager{
		onlineUsers: make(map[int64]*UserProcess, 1024),
	}
}

func (um *UserManager) AddOnlineUser(up *UserProcess) {
	um.onlineUsers[up.UserId] = up
}

func (um *UserManager) DelByUserId(userId int64)  {
	delete(um.onlineUsers, userId)
}

func (um *UserManager) GetAllOnlineUsers() map[int64]*UserProcess {
	return um.onlineUsers
}
